package com.echo.register.commons.result;

import java.util.HashMap;
import java.util.Map;

/**
 * 系统统一返回码
 *
 * @author Echo-cxt
 * @create 2017-11-07 3:52 PM
 **/
public class RetCode {
    /** 操作成功 **/
    public static final String SUCCESS      = "0000";
    /** 操作失败 **/
    public static final String FAIL         = "1111";

    public static final String FAIL_COOKIE  = "2222";
    /** 系统繁忙 **/
    public static final String SYSTEM_BUSY  = "8888";
    /** 会话超时 **/
    public static final String SESSION_TIMEOUT = "9999";
    /** 参数校验失败 **/
    public static final String FORM_VALIDATE_FAIL = "900504";
    /** um超过投票限制 **/
    public static final String UM_OVER_LIMTI = "800001";

    private static Map<Object, String> CODE_MAP = new HashMap<Object, String>();

    static {
        CODE_MAP.put(SUCCESS, "操作成功");
        CODE_MAP.put(FAIL, "操作失败");
        CODE_MAP.put(SYSTEM_BUSY, "系统繁忙");
        CODE_MAP.put(SESSION_TIMEOUT, "会话超时，请重新登陆");
        CODE_MAP.put(FORM_VALIDATE_FAIL, "传入参数校验失败");
        CODE_MAP.put(FAIL_COOKIE, "获取不到Cookie");
        CODE_MAP.put(UM_OVER_LIMTI, "um超过投票限制");
    }

    public static String GetMsg(Object code){
        return CODE_MAP.get(code);
    }

}
